﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TankWar.Properties;


namespace TankWar
{
    class GameObjectManager
    {
        private static List<NotMovething> wallLists = new List<NotMovething>();


        // 把管理住的对象都绘制出来
        public static void DrawMap()
        {
            foreach (var obj in wallLists)
            { 
                obj.DrawSelf();
            }
        }

        public static void CreateMap()
        {
            CreateWall(1,1,5,wallLists);
            
        }

        // 写一个方法来模块化 CreateWall的功能， 绘制一列墙
        private static void CreateWall(int x, int y ,int count, List<NotMovething> wallList)
        {
            int xpostion = x*30;
            int ypostion = y*30;
            for (int i = ypostion; i<ypostion + count*30; i+=15)
            {
                NotMovething one = new NotMovething(xpostion,i,Resources.wall);
                NotMovething two = new NotMovething(xpostion +15,i,Resources.wall);
                wallList.Add(one);
                wallList.Add(two);
            }
            
        }


    }
}
